﻿@using Treca.PushMessage.Entity;
@using Treca.Util;
@using EFCore.Sharding; 
@using Treca.Business.Base_SysManage;
@inherits DependencyViewPage 
@using System.Data;
@using Microsoft.AspNetCore.Http;
@using Treca.Base_SysManage.Entity;
@using EFCore.Sharding.ExField;
@{
    Layout = "~/Views/Shared/_Layout_NewForm.cshtml";

    var obj = (ms_messageservice)Model;
    var objStr = Html.Raw(obj.ToJson());
    Boolean isview = (Boolean)this.ViewData["isview"];
    BaseDataHelper dataHelper = (BaseDataHelper)this.ViewData["listHelper"];
    
}
<script>
    var isview =@isview.ToString().ToLower();
    var theEntity = @objStr;
    var mcelist = [];
</script>
<div class="fx-wrapper">
      <form class="form-inline" id="searchForm"   style="width: 800px"> 
         <div class="form-group">             
          <!--    <div class="col-sm-2 input-icon-group"  style="width: 60 % "> 
                添加文件
               <div id="WorkerContractImg" style="width:120px;height:104px;overflow:inherit" ></div>
            </div>
            <button type = "button" class="btn btn-info btn-sm" onclick="speech()" );" >
                <i class="glyphicon glyphicon-export" ></i>
                语音输入
            </button>
            <input type = "file1" id="file1" name ="myfile1" style="display: none" />
      
            <button type = "button" class="btn btn-success btn-sm" onclick="OCRForm()" );" >
                <i class="glyphicon glyphicon-export" ></i>
                表单识别
            </button> -->
                <!-- <button id = "submit" type="button" > 提交</button>-->

        </div>
    </form>
</div>
<div style="padding:15px;padding-right:45px;">
    <form id="form" class="form-horizontal" role="form">
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_servicename","消息服务名称")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectservicename = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "servicename");
                                        if(!dataselectservicename.sr.IsNullOrEmpty()&&!dataselectservicename.sr.Id.IsNullOrEmpty()){
                                             if( dataselectservicename.bs.selecttype=="1")
                                            {
                                                 <select id="servicename" name="servicename" value="@obj.servicename" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectservicename.data.Rows)
                                                {
                                                      if((","+@obj.servicename+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectservicename.bs.selecttype=="3")
                                            {
                                                <select id="servicename" name="servicename" value="@obj.servicename" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectservicename.data.Rows)
                                                {
                                                      if((","+@obj.servicename+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectservicename.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var servicenameval="";
                                                    @foreach (DataRow rows in dataselectservicename.data.Rows)
                                                    {
                                                          if((","+@obj.servicename+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             servicenameval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectservicename.sr.tablename.Split('.')[@dataselectservicename.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectservicename.sr.tablename.Split('.')[@dataselectservicename.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='servicename__Name' name='servicename__Name' value='@servicenameval' onclick='openFormSelect("/@areaname/@typename","@dataselectservicename.sr.filedcode,@dataselectservicename.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='servicename' name='servicename' value='@obj.servicename' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectservicename.bs.selecttype=="4")
                                             {
                                                 <div id='servicename__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='servicename__Name' name='servicename__Name' value='@obj.servicename' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='servicename' name='servicename' value='@obj.servicename'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#servicename__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#servicename__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#servicename__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#servicename').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#servicename__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectservicename.bs.selecttype == "6")
                                                {
                                                    <input id='servicename' name='servicename' value='@obj.servicename' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='servicename__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectservicename.data.Rows)
                                                        {
                                                            if ((',' + @obj.servicename + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#servicename__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#servicename').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#servicename__Name').keyup(function(){
                                                               $('#servicename').val($('#servicename__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectservicename.bs.selecttype == "7")
                                                {
                                                    <div id="servicename" name="servicename" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#servicename',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#servicename').html(theEntity.servicename);
                                                                mcelist.push('servicename');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#servicename',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#servicename').html(theEntity.servicename);
                                                                 mcelist.push('servicename');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="servicename" name="servicename"  maxlength="100" value="@obj.servicename" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_servicetype","消息服务名称")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectservicetype = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "servicetype");
                                        if(!dataselectservicetype.sr.IsNullOrEmpty()&&!dataselectservicetype.sr.Id.IsNullOrEmpty()){
                                             if( dataselectservicetype.bs.selecttype=="1")
                                            {
                                                 <select id="servicetype" name="servicetype" value="@obj.servicetype" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectservicetype.data.Rows)
                                                {
                                                      if((","+@obj.servicetype+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectservicetype.bs.selecttype=="3")
                                            {
                                                <select id="servicetype" name="servicetype" value="@obj.servicetype" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectservicetype.data.Rows)
                                                {
                                                      if((","+@obj.servicetype+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectservicetype.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var servicetypeval="";
                                                    @foreach (DataRow rows in dataselectservicetype.data.Rows)
                                                    {
                                                          if((","+@obj.servicetype+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             servicetypeval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectservicetype.sr.tablename.Split('.')[@dataselectservicetype.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectservicetype.sr.tablename.Split('.')[@dataselectservicetype.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='servicetype__Name' name='servicetype__Name' value='@servicetypeval' onclick='openFormSelect("/@areaname/@typename","@dataselectservicetype.sr.filedcode,@dataselectservicetype.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='servicetype' name='servicetype' value='@obj.servicetype' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectservicetype.bs.selecttype=="4")
                                             {
                                                 <div id='servicetype__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='servicetype__Name' name='servicetype__Name' value='@obj.servicetype' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='servicetype' name='servicetype' value='@obj.servicetype'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#servicetype__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#servicetype__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#servicetype__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#servicetype').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#servicetype__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectservicetype.bs.selecttype == "6")
                                                {
                                                    <input id='servicetype' name='servicetype' value='@obj.servicetype' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='servicetype__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectservicetype.data.Rows)
                                                        {
                                                            if ((',' + @obj.servicetype + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#servicetype__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#servicetype').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#servicetype__Name').keyup(function(){
                                                               $('#servicetype').val($('#servicetype__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectservicetype.bs.selecttype == "7")
                                                {
                                                    <div id="servicetype" name="servicetype" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#servicetype',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#servicetype').html(theEntity.servicetype);
                                                                mcelist.push('servicetype');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#servicetype',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#servicetype').html(theEntity.servicetype);
                                                                 mcelist.push('servicetype');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="servicetype" name="servicetype"  maxlength="30" value="@obj.servicetype" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_appid","AppId")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectappid = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "appid");
                                        if(!dataselectappid.sr.IsNullOrEmpty()&&!dataselectappid.sr.Id.IsNullOrEmpty()){
                                             if( dataselectappid.bs.selecttype=="1")
                                            {
                                                 <select id="appid" name="appid" value="@obj.appid" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectappid.data.Rows)
                                                {
                                                      if((","+@obj.appid+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectappid.bs.selecttype=="3")
                                            {
                                                <select id="appid" name="appid" value="@obj.appid" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectappid.data.Rows)
                                                {
                                                      if((","+@obj.appid+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectappid.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var appidval="";
                                                    @foreach (DataRow rows in dataselectappid.data.Rows)
                                                    {
                                                          if((","+@obj.appid+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             appidval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectappid.sr.tablename.Split('.')[@dataselectappid.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectappid.sr.tablename.Split('.')[@dataselectappid.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='appid__Name' name='appid__Name' value='@appidval' onclick='openFormSelect("/@areaname/@typename","@dataselectappid.sr.filedcode,@dataselectappid.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='appid' name='appid' value='@obj.appid' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectappid.bs.selecttype=="4")
                                             {
                                                 <div id='appid__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='appid__Name' name='appid__Name' value='@obj.appid' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='appid' name='appid' value='@obj.appid'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#appid__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#appid__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#appid__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#appid').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#appid__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectappid.bs.selecttype == "6")
                                                {
                                                    <input id='appid' name='appid' value='@obj.appid' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='appid__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectappid.data.Rows)
                                                        {
                                                            if ((',' + @obj.appid + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#appid__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#appid').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#appid__Name').keyup(function(){
                                                               $('#appid').val($('#appid__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectappid.bs.selecttype == "7")
                                                {
                                                    <div id="appid" name="appid" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#appid',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#appid').html(theEntity.appid);
                                                                mcelist.push('appid');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#appid',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#appid').html(theEntity.appid);
                                                                 mcelist.push('appid');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="appid" name="appid"  maxlength="100" value="@obj.appid" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_appsecret","AppSecret")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectappsecret = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "appsecret");
                                        if(!dataselectappsecret.sr.IsNullOrEmpty()&&!dataselectappsecret.sr.Id.IsNullOrEmpty()){
                                             if( dataselectappsecret.bs.selecttype=="1")
                                            {
                                                 <select id="appsecret" name="appsecret" value="@obj.appsecret" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectappsecret.data.Rows)
                                                {
                                                      if((","+@obj.appsecret+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectappsecret.bs.selecttype=="3")
                                            {
                                                <select id="appsecret" name="appsecret" value="@obj.appsecret" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectappsecret.data.Rows)
                                                {
                                                      if((","+@obj.appsecret+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectappsecret.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var appsecretval="";
                                                    @foreach (DataRow rows in dataselectappsecret.data.Rows)
                                                    {
                                                          if((","+@obj.appsecret+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             appsecretval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectappsecret.sr.tablename.Split('.')[@dataselectappsecret.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectappsecret.sr.tablename.Split('.')[@dataselectappsecret.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='appsecret__Name' name='appsecret__Name' value='@appsecretval' onclick='openFormSelect("/@areaname/@typename","@dataselectappsecret.sr.filedcode,@dataselectappsecret.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='appsecret' name='appsecret' value='@obj.appsecret' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectappsecret.bs.selecttype=="4")
                                             {
                                                 <div id='appsecret__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='appsecret__Name' name='appsecret__Name' value='@obj.appsecret' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='appsecret' name='appsecret' value='@obj.appsecret'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#appsecret__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#appsecret__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#appsecret__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#appsecret').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#appsecret__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectappsecret.bs.selecttype == "6")
                                                {
                                                    <input id='appsecret' name='appsecret' value='@obj.appsecret' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='appsecret__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectappsecret.data.Rows)
                                                        {
                                                            if ((',' + @obj.appsecret + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#appsecret__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#appsecret').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#appsecret__Name').keyup(function(){
                                                               $('#appsecret').val($('#appsecret__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectappsecret.bs.selecttype == "7")
                                                {
                                                    <div id="appsecret" name="appsecret" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#appsecret',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#appsecret').html(theEntity.appsecret);
                                                                mcelist.push('appsecret');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#appsecret',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#appsecret').html(theEntity.appsecret);
                                                                 mcelist.push('appsecret');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="appsecret" name="appsecret"  maxlength="100" value="@obj.appsecret" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_encodingaeskey","EncodingAESKey")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectencodingaeskey = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "encodingaeskey");
                                        if(!dataselectencodingaeskey.sr.IsNullOrEmpty()&&!dataselectencodingaeskey.sr.Id.IsNullOrEmpty()){
                                             if( dataselectencodingaeskey.bs.selecttype=="1")
                                            {
                                                 <select id="encodingaeskey" name="encodingaeskey" value="@obj.encodingaeskey" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectencodingaeskey.data.Rows)
                                                {
                                                      if((","+@obj.encodingaeskey+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectencodingaeskey.bs.selecttype=="3")
                                            {
                                                <select id="encodingaeskey" name="encodingaeskey" value="@obj.encodingaeskey" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectencodingaeskey.data.Rows)
                                                {
                                                      if((","+@obj.encodingaeskey+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectencodingaeskey.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var encodingaeskeyval="";
                                                    @foreach (DataRow rows in dataselectencodingaeskey.data.Rows)
                                                    {
                                                          if((","+@obj.encodingaeskey+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             encodingaeskeyval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectencodingaeskey.sr.tablename.Split('.')[@dataselectencodingaeskey.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectencodingaeskey.sr.tablename.Split('.')[@dataselectencodingaeskey.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='encodingaeskey__Name' name='encodingaeskey__Name' value='@encodingaeskeyval' onclick='openFormSelect("/@areaname/@typename","@dataselectencodingaeskey.sr.filedcode,@dataselectencodingaeskey.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='encodingaeskey' name='encodingaeskey' value='@obj.encodingaeskey' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectencodingaeskey.bs.selecttype=="4")
                                             {
                                                 <div id='encodingaeskey__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='encodingaeskey__Name' name='encodingaeskey__Name' value='@obj.encodingaeskey' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='encodingaeskey' name='encodingaeskey' value='@obj.encodingaeskey'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#encodingaeskey__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#encodingaeskey__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#encodingaeskey__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#encodingaeskey').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#encodingaeskey__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectencodingaeskey.bs.selecttype == "6")
                                                {
                                                    <input id='encodingaeskey' name='encodingaeskey' value='@obj.encodingaeskey' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='encodingaeskey__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectencodingaeskey.data.Rows)
                                                        {
                                                            if ((',' + @obj.encodingaeskey + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#encodingaeskey__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#encodingaeskey').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#encodingaeskey__Name').keyup(function(){
                                                               $('#encodingaeskey').val($('#encodingaeskey__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectencodingaeskey.bs.selecttype == "7")
                                                {
                                                    <div id="encodingaeskey" name="encodingaeskey" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#encodingaeskey',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#encodingaeskey').html(theEntity.encodingaeskey);
                                                                mcelist.push('encodingaeskey');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#encodingaeskey',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#encodingaeskey').html(theEntity.encodingaeskey);
                                                                 mcelist.push('encodingaeskey');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="encodingaeskey" name="encodingaeskey"  maxlength="100" value="@obj.encodingaeskey" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_token","Token")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselecttoken = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "token");
                                        if(!dataselecttoken.sr.IsNullOrEmpty()&&!dataselecttoken.sr.Id.IsNullOrEmpty()){
                                             if( dataselecttoken.bs.selecttype=="1")
                                            {
                                                 <select id="token" name="token" value="@obj.token" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselecttoken.data.Rows)
                                                {
                                                      if((","+@obj.token+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselecttoken.bs.selecttype=="3")
                                            {
                                                <select id="token" name="token" value="@obj.token" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselecttoken.data.Rows)
                                                {
                                                      if((","+@obj.token+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselecttoken.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var tokenval="";
                                                    @foreach (DataRow rows in dataselecttoken.data.Rows)
                                                    {
                                                          if((","+@obj.token+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             tokenval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselecttoken.sr.tablename.Split('.')[@dataselecttoken.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselecttoken.sr.tablename.Split('.')[@dataselecttoken.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='token__Name' name='token__Name' value='@tokenval' onclick='openFormSelect("/@areaname/@typename","@dataselecttoken.sr.filedcode,@dataselecttoken.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='token' name='token' value='@obj.token' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselecttoken.bs.selecttype=="4")
                                             {
                                                 <div id='token__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='token__Name' name='token__Name' value='@obj.token' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='token' name='token' value='@obj.token'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#token__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#token__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#token__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#token').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#token__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselecttoken.bs.selecttype == "6")
                                                {
                                                    <input id='token' name='token' value='@obj.token' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='token__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselecttoken.data.Rows)
                                                        {
                                                            if ((',' + @obj.token + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#token__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#token').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#token__Name').keyup(function(){
                                                               $('#token').val($('#token__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselecttoken.bs.selecttype == "7")
                                                {
                                                    <div id="token" name="token" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#token',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#token').html(theEntity.token);
                                                                mcelist.push('token');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#token',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#token').html(theEntity.token);
                                                                 mcelist.push('token');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="token" name="token"  maxlength="100" value="@obj.token" type="text" class="form-control column" >}}
                                </div>
                            </div>
                        <div class="form-group form-group-sm">
                            <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_FsNo","排序")</label>
                            <div class="col-sm-5">
                                    <input id="FsNo" name="FsNo"  maxlength="1000" placeholder="0" value="@obj.FsNo" type="number" class="form-control column" >
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messageservice_Remark","描述")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectRemark = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", "Remark");
                                        if(!dataselectRemark.sr.IsNullOrEmpty()&&!dataselectRemark.sr.Id.IsNullOrEmpty()){
                                             if( dataselectRemark.bs.selecttype=="1")
                                            {
                                                 <select id="Remark" name="Remark" value="@obj.Remark" class="form-control column selectpicker" data-live-search="true" >
                                                @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                {
                                                      if((","+@obj.Remark+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            
                                            }
                                            else if( dataselectRemark.bs.selecttype=="3")
                                            {
                                                <select id="Remark" name="Remark" value="@obj.Remark" class="form-control column selectpicker" data-live-search="true" multiple >
                                                @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                {
                                                      if((","+@obj.Remark+",").Contains(","+rows[0].ToString()+","))
                                                      {
                                                         <option value="@rows[0]" selected>@rows[1]</option>
                                                      }
                                                      else
                                                      {
                                                         <option value="@rows[0]">@rows[1]</option>
                                                      }
                                                }
                                                </select>
                                            }
                                             else if( dataselectRemark.bs.selecttype=="2")
                                             {
                                                    List<string> strs=new List<string>();
                                                    var Remarkval="";
                                                    @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                    {
                                                          if((","+@obj.Remark+",").Contains(","+rows[0].ToString()+","))
                                                          {
                                                             strs.Add(rows[1].ToString());
                                                             Remarkval=string.Join(",", strs);
                                                          }
                                                    }
                                                string typename = @dataselectRemark.sr.tablename.Split('.')[@dataselectRemark.sr.tablename.Split('.').Length - 1];
                                                string areaname = @dataselectRemark.sr.tablename.Split('.')[@dataselectRemark.sr.tablename.Split('.').Length - 3];
                                                <input  readonly='readonly' id='Remark__Name' name='Remark__Name' value='@Remarkval' onclick='openFormSelect("/@areaname/@typename","@dataselectRemark.sr.filedcode,@dataselectRemark.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'>
                                                <input  readonly='readonly' id='Remark' name='Remark' value='@obj.Remark' type='text' style='display:none' class='form-control column'  readonly='readonly'>
                                              }
                                             else if( dataselectRemark.bs.selecttype=="4")
                                             {
                                                 <div id='Remark__Img' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='Remark__Name' name='Remark__Name' value='@obj.Remark' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='Remark' name='Remark' value='@obj.Remark'  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#Remark__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                  @Html.Raw("sizeLimit: 5,    //大小限制，M\n");
                                                  @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#Remark__Name').trigger('propertychange');});\n");
                                                  @Html.Raw("$('#Remark__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#Remark').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#Remark__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                            } else if (dataselectRemark.bs.selecttype == "6")
                                                {
                                                    <input id='Remark' name='Remark' value='@obj.Remark' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                    <select  id='Remark__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                        {
                                                            if ((',' + @obj.Remark + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#Remark__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#Remark').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#Remark__Name').keyup(function(){
                                                               $('#Remark').val($('#Remark__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselectRemark.bs.selecttype == "7")
                                                {
                                                    <div id="Remark" name="Remark" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#Remark',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#Remark').html(theEntity.Remark);
                                                                mcelist.push('Remark');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#Remark',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#Remark').html(theEntity.Remark);
                                                                 mcelist.push('Remark');
                                                         }
                                                    </script>

                                                }
                                            }
                                        else {
                                        <input id="Remark" name="Remark"  maxlength="200" value="@obj.Remark" type="text" class="form-control column" >}}
                                </div>
                            </div>
         @{
            List<base_extendedfield> exs = dataHelper.GetExFileds("PushMessage", "ms_messageservice");
            foreach (var ex in exs)
            {

                                        Type type = ExFielddHelper.GetFieldType(ex.filedtype);
                                        if (ex.exfiled.Equals("StatusFlag", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("CreateDate", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("CreateOperator", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("ApproveDate", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("ApproveOperator", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("PostDate", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("PostOperator", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("ModifyDate", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("IsDelete", StringComparison.OrdinalIgnoreCase)
                                               || ex.exfiled.Equals("ModifyOperator", StringComparison.OrdinalIgnoreCase))
                                            return;
                        //Form页面中的Html
                        string newFormRow = $@"";
                        string minview = "text";
                        string format = "yyyy-MM-dd HH:mm:ss";
                        string formatpicker = "yyyy-mm-dd hh:ii:ss";
                        string required = "";
                        string hidden = "";
                        //if (ex.IsAllowNull == "1")
                        //{
                        //    required = "";
                        //}

                        //if (ex.IsFieldShow == "1")
                        //{
                        //    hidden = "";
                        //}
                        if (ex.filedtype.Equals("date", StringComparison.OrdinalIgnoreCase))
                        {
                            minview = "text";
                            format = "yyyy-MM-dd";
                            formatpicker = "yyyy-mm-dd";
                        }
                        if (type == typeof(DateTime))
                        {
                                            <div class="form-group form-group-sm" @hidden>
                                                <label class="col-sm-4 control-label">@ex.filedname</label>
                                                <div class="col-sm-8">
                                                    <input  id="@ex.exfiled" name="@ex.exfiled" data-date-format="@format" maxlength="@ex." value="@obj.{@ex.exfiled}.ToString('@format')" type="@minview" class="form-control column Wdate" @required>
                                                    <div class="help-block with-errors"></div>
                                                </div>
                                            </div>
                         }
                         else if (type == typeof(DateTime?))
                         {
                                            <div class="form-group form-group-sm" @hidden>
                                                <label class="col-sm-4 control-label">@ex.filedname</label>
                                                <div class="col-sm-8">
                                                    <input id="@ex.exfiled" name="@ex.exfiled" data-date-format="{format}" maxlength="100" value="@obj.{@ex.exfiled}.ToString('@format')" type="@minview" class="form-control column Wdate" @required>
                                                    <div class="help-block with-errors"></div>
                                                </div>
                                            </div>
                                        }
              else if (type == typeof(string) || type == typeof(String))
            {
                <div class='form-group form-group-sm'>
                <label class='col-sm-2 control-label'>@TranslateService.GetTranslate("", $@"PushMessage_ms_messageservice_{ex.exfiled}", $@"{ex.filedname}")</label>
                    <div class='col-sm-5'>
                            @{base_selectresource_data dataselect = dataHelper.GetDataUrlAll("PushMessage", "ms_messageservice", $@"{ex.exfiled}");
                                if (!dataselect.sr.IsNullOrEmpty() && !dataselect.sr.Id.IsNullOrEmpty())
                                {
                                    if (dataselect.bs.selecttype == "1")
                                    {
                                        <select id='@ex.exfiled' name='@ex.exfiled' value='@obj[ex.exfiled]' class='form-control column selectpicker' data-live-search='true'>
                                            @foreach (DataRow rows in dataselect.data.Rows)
                                            {
                                                if ((',' + obj[ex.exfiled]?.ToString() + ',').Contains(',' + rows[0].ToString() + ','))
                                                {
                                                    <option value='@rows[0]' selected>@rows[1]</option>
                                                }
                                                else
                                                {
                                                    <option value='@rows[0]'>@rows[1]</option>
                                                }
                                            }
                                        </select>

                                    }
                                    else if(dataselect.bs.selecttype == "3")
                                    {
                                        <select id='@ex.exfiled' name='@ex.exfiled' value='@obj[ex.exfiled]?.ToString()' class='form-control column selectpicker' data-live-search='true' multiple>
                                            @foreach (DataRow rows in dataselect.data.Rows)
                                            {
                                                if ((',' + @obj[ex.exfiled]?.ToString() + ',').Contains(',' + rows[0].ToString() + ','))
                                                {
                                                    <option value='@rows[0]' selected>@rows[1]</option>
                                                }
                                                else
                                                {
                                                    <option value='@rows[0]'>@rows[1]</option>
                                                }
                                            }
                                        </select>
                                    }
                                    else if (dataselect.bs.selecttype == "2")
                                    {
                                        List<string> strs = new List<string>();
                                        var Remarkval = "";
                                        @foreach (DataRow rows in dataselect.data.Rows)
                                        {
                                            if ((',' + @obj[ex.exfiled]?.ToString() + ',').Contains(',' + rows[0].ToString() + ','))
                                            {
                                                strs.Add(rows[1].ToString());
                                                Remarkval = string.Join(",", strs);
                                            }
                                        }
                                        string typename = dataselect.sr.tablename.Split('.')[dataselect.sr.tablename.Split('.').Length - 1];
                                        string areaname = dataselect.sr.tablename.Split('.')[dataselect.sr.tablename.Split('.').Length - 3];
                                        <input readonly='readonly' id='@ex.exfiled.ToString()__Name' name='@ex.exfiled.ToString()__Name' value='@Remarkval' onclick='openFormSelect('/@areaname/@typename','@dataselect.sr.filedcode,@dataselect.sr.filedvalue',this); ' type='text' class='form-control column' readonly='readonly'>
                                        <input readonly='readonly' id='@ex.exfiled' name='{@ex.exfiled}' value='@obj[ex.exfiled]?.ToString()' type='text' style='display:none' class='form-control column' readonly='readonly'>
                                    }
                                    else if (dataselect.bs.selecttype == "4")
                                    {
                                        <div id='@ex.exfiled.ToString()__Img' style='width:100%; height:200px; overflow: auto'></div>
                                        <input id='@ex.exfiled.ToString()__Name' name='@ex.exfiled.ToString()__Name' value='@obj[ex.exfiled]?.ToString()' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                        <input id='@ex.exfiled' name='@ex.exfiled' value='@obj[ex.exfiled]?.ToString()' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                                  @Html.Raw("<script>\n");
                                                     @Html.Raw("$(function(){\n");
                                                     @Html.Raw("$('#"+@ex.exfiled+"__Img').html5Uploader({\n");
                                                     @Html.Raw("asyncUpload: true,\n");
                                                     @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                     @Html.Raw("uploadLimit: 0,  //上传数量限制，0为不限\n");
                                                     @Html.Raw("sizeLimit: 50,    //大小限制，M\n");
                                                     @Html.Raw("type: 'file' //file即可上传文件也可上传图片\n");
                                                     @Html.Raw("});\n");
                                                     @Html.Raw("$('#"+@ex.exfiled+"__Name').trigger('propertychange');});\n");
                                                     @Html.Raw("$('#"+@ex.exfiled+"__Name').on(' input propertychange',function(){\n");
                                                     @Html.Raw("var urls = $(this).val().split(',');\n");
                                                     @Html.Raw("var ids = $('#"+@ex.exfiled+"').val().split(',');\n");
                                                     @Html.Raw("$.each(urls, function(index, url){\n");
                                                     @Html.Raw("if(url!='')\n");
                                                     @Html.Raw("$('#"+@ex.exfiled+"__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                     @Html.Raw("});\n");
                                                     @Html.Raw("});\n");
                                                     @Html.Raw("</script>\n");
                                    }
                                                 else if (dataselect.bs.selecttype == "6")
                                                {
                                                    <input id='@ex.exfiled' name='@ex.exfiled' value='@obj.GetPropertyValue(ex.exfiled)?.ToString()' type='text' style='display:none' class='form-control column' readonly='readonly' @required/>
                                                    <select  id='@ex.exfiled.ToString()__Name'  class='form-control column' data-live-search='true' >
                                                        @foreach (DataRow rows in dataselect.data.Rows)
                                                        {
                                                            if ((',' + obj.GetPropertyValue(ex.exfiled)?.ToString() + ',').Contains(',' + rows[0].ToString() + ','))
                                                            {
                                                                <option value='@rows[0]' selected>@rows[1]</option>
                                                            }
                                                            else
                                                            {
                                                                <option value='@rows[0]'>@rows[1]</option>
                                                            }
                                                        }
                                                    </select>
                                                    <script>
                                                         //初始化控件
                                                        $('#@ex.exfiled.ToString()__Name').on('select.editable-select', function (e,li) {
                                                            // do something...
                                                            $('#@ex.exfiled.ToString()').val(li.attr('value'));
                                                            }).editableSelect();
                                                        $('#@ex.exfiled.ToString()__Name').keyup(function(){
                                                               $('#@ex.exfiled.ToString()').val($('#@ex.exfiled.ToString()__Name').val());
                                                        });
                                                    </script>

                                                }
                                                else if (dataselect.bs.selecttype == "7")
                                                {
                                                    <div id="@ex.exfiled" name="@ex.exfiled" ></div>
                                                    <script>
                                                          //富文本编辑器
                                                            if (isview) {
                                                                tinymce.init({
                                                                    selector: '#@ex.exfiled',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,
                                                                    readonly: 1,
                                                                });
                                                               $('#@ex.exfiled').html(theEntity.@ex.exfiled);
                                                                mcelist.push('@ex.exfiled');
                                                            }
                                                            else {
                                                                tinymce.init({
                                                                    selector: '#@ex.exfiled',
                                                                    language: 'zh_CN',
                                                                    contextmenu: false,
                                                                    plugins: 'print preview searchreplace autolink directionality visualchars fullscreen image link media template code table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern paste emoticons bdmap indent2em autoresize',
                                                                    toolbar: 'code forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright indent2em lineheight | \
                                                                        bullist numlist | blockquote subscript superscript removeformat | \
                                                                        table emoticons charmap hr  insertdatetime | fullscreen ',
                                                                    menubar: false,
                                                                    fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
                                                                    autosave_ask_before_unload: false,
                                                                    toolbar_drawer: false,

                                                                });
                                                                $('#@ex.exfiled').html(theEntity.@ex.exfiled);
                                                                 mcelist.push('@ex.exfiled');
                                                         }
                                                    </script>

                                                }
                                }
                                else
                                {
                                    <input id='@ex.exfiled' name='@ex.exfiled' maxlength='100' value='@obj[ex.exfiled]?.ToString()' type='text' class='form-control column'>
                                }
                            }
                    </div>
                </div>
}
                        else if (type == typeof(int) || type == typeof(Int32))
                        {
                            <div class="form-group form-group-sm" @hidden>
                                <label class="col-sm-4 control-label">@TranslateService.GetTranslate("", $@"PushMessage_ms_messageservice_{ex.exfiled}", $@"{ex.filedname}")</label>
                                <div class="col-sm-8">
                                    <input id="@ex.exfiled" name="@ex.exfiled" maxlength="{aField.ColumnLength}" placeholder="0" value="@obj.@ex.exfiled" type="number" class="form-control column" @required>
                                    <div class="help-block with-errors"></div>
                                </div>
                            </div>
                        }
                        else if (type == typeof(Decimal) || type == typeof(decimal))
                        {
                            <div class="form-group form-group-sm" @hidden>
                                <label class="col-sm-4 control-label">@TranslateService.GetTranslate("", $@"PushMessage_ms_messageservice_{ex.exfiled}", $@"{ex.filedname}")</label>
                                <div class="col-sm-8">
                                    <input id="@ex.exfiled" name="@ex.exfiled" maxlength="{aField.ColumnLength}" placeholder="0" value="@obj.@ex.exfiled" type="number" step="0.000001" class="form-control column" @required>
                                    <div class="help-block with-errors"></div>
                                </div>
                            </div>
                        }
                        else
                        {
                            <div class="form-group form-group-sm" @hidden>
                                <label class="col-sm-4 control-label">@TranslateService.GetTranslate("", $@"PushMessage_ms_messageservice_{ex.exfiled}", $@"{ex.filedname}")</label>
                                <div class="col-sm-8">
                                    <input id="@ex.exfiled" name="@ex.exfiled" maxlength="{ex.ColumnLength}" value="@obj.@ex.exfiled" type="text" class="form-control column" @required>
                                    <div class="help-block with-errors"></div>
                                </div>
                            </div>
                        }
             }
        }
        <!-- tab标签 -->
        <ul id='myTab' class='nav nav-tabs'>
            
        </ul>
        <div id='myTabContent' class='tab-content'>
            
        </div>
        <div class="form-group">
            <button id="submit" type="submit" class="hidden">@TranslateService.GetTranslate("","System_Submit","提交")</button>
        </div>
    </form>
</div>
<script class='col-sm-5'>
                @{
                    List<base_linkage> links = dataHelper.GetLinks("PushMessage", "ms_messageservice");
                    foreach(var link in links)
                    {
                            @Html.Raw($@"
                            $('#{link.tablefiled}').change(function () {{
                                var values = $('#form').getValues();

                                $.extend(theEntity, values);
                                var dataValue = {{}};
                                for (var item in theEntity) {{
                                    if (theEntity[item] != null)
                                        theEntity[item] = theEntity[item].toString();
                                }}
                                dataValue['theData'] = theEntity;
                                dataValue['areaName'] = 'PushMessage';
                                dataValue['entityName'] = 'ms_messageservice';
                                dataValue['FiledName'] = '{link.tablefiled}';
                                dataValue['ValueName'] = '{link.linkfiled}';

                                $.postJSON('/PushMessage/ms_messageservice/GetLinkData', dataValue, function (resJson) {{
                                    if (resJson.Success) {{
                                        if ($('#{link.linkfiled}').prop('nodeName') == 'SELECT') {{
                                            var filedvalue=$('#{link.linkfiled}').val();
                                            $('#{link.linkfiled}').empty();
                                            for (var i=0;i<resJson.Data.data.length;i++) {{
                                                var item=resJson.Data.data[i];
                                                var opt = new Option(item[resJson.Data.sr.filedvalue+'C'],item[resJson.Data.sr.filedcode])
                                                $('#{link.linkfiled}').append(opt);
                                            }}
                                            if(filedvalue!='')
                                            $('#{link.linkfiled}').selectpicker('val',filedvalue)
                                            $('#{link.linkfiled}').selectpicker('refresh');
                                            if(((resJson.Data.data.length==1&&resJson.Data.bs.selecttype!='1')||(resJson.Data.bs.selecttype=='1'&&resJson.Data.data.length==2))){{
                                                    $('#{link.linkfiled}').selectpicker('val',resJson.Data.data[resJson.Data.data.length-1][resJson.Data.sr.filedcode]);
                                            }}
                                            $('#{link.linkfiled}').selectpicker('refresh');
                                        }} else {{
                                            if (resJson.Data.data.length > 0){{
                                                if(((resJson.Data.data.length==1&&resJson.Data.bs.selecttype!='1')||(resJson.Data.bs.selecttype=='1'&&resJson.Data.data.length==2))){{
                                                    $('#{link.linkfiled}').val(resJson.Data.data[resJson.Data.data.length-1][resJson.Data.sr.filedcode]);
                                                }}
                                            }}
                                        }}
                                    }}
                                    else {{
                                        dialogError(resJson.Msg);
                                    }}
                                }});
                            }});
                            ");
                    }
                }
            </script>
<script>
    
    $(function () {
        initEvent();
        if(isview)
        {
            $(".column").attr("disabled",true);
        }
    });

    //事件绑定
    function initEvent() {
        //表单校验
        $('#form').validator().on('submit', function (e) {
            //校验成功
            if (!e.isDefaultPrevented()) {
                e.preventDefault();

                var values = $('#form').getValues();
                
                $.extend(theEntity, values);
                loading();
                var dataValue = {};
                for (var item in theEntity){
                    if(theEntity[item]!=null)
                    theEntity[item] = theEntity[item].toString();
                }
                for (var mce in mcelist){
                   theEntity[mcelist[mce]] = tinymce.get(mcelist[mce]).getContent();
                }
                dataValue['theData'] = theEntity;
                
                $.postJSONByJson('/PushMessage/ms_messageservice/MainSaveData', dataValue, function (resJson) {
                    loading(false);

                    if (resJson.Success) {
                        parent.$('#dataTable').bootstrapTable('refresh');
                        parent.dialogSuccess();
                        
                        dialogClose();
                    }
                    else {
                        dialogError(resJson.Msg);
                    }
                });
            }
        })
    }

    //提交表单
    function submitForm() {
        $('#submit').trigger('click');
    }
    //清除表单数据
    function clearForm() {
        
    }
     $(function () {
        $('#WorkerContractImg').html5Uploader({
            //imgs: theEntity[aImgId],
            asyncUpload: true,
            uploadUrl: '/Base_SysManage/Common/UploadFile',
            uploadLimit: 0,  //上传数量限制，0为不限
            sizeLimit: 5,    //大小限制，M
            type:'file' //file即可上传文件也可上传图片
        });
    });

    
    //手写文字识别
    function OCRForm() {
        //获取上传后的url
        var url = $('#WorkerContractImg').html5Uploader('getUploadFiles');
        //console.log(url);   
        // 返回 web 主机的域名，如：http://127.0.0.1:8080/testdemo/test.html?id=1&name=test
        var href = window.location.href; 
        // 返回当前页面的路径和文件名，如：/testdemo/test.html
        var pathname = window.location.pathname;
        pathname = href.replace(pathname, "");
        // 获取参数，如：?id=1&name=test
        var search = window.location.search;
        pathname = pathname.replace(search, "") + " / ";


        url = (String(url)).replace(pathname, "");
            url = url.replace(/\//g, "\\");


            loading();
        $.postJSON('/Visit/visit_type_authorize/OCRData', { FileName: (url) }, function (resJson) {
                //loading(false);
                if (resJson.Success) {
                   $table.bootstrapTable('refresh');
                    dialogSuccess('表单识别成功!');
                }
                else {
                    dialogError(resJson.Msg);
                }
            });       
    }
    //语音识别输入
    function speech() {
    alert('功能完善中');
    }
 
    function openFormSelect(modelurl,returnkey,obj) {
        dialogOpen({
            id: 'form1',
            title: '@TranslateService.GetTranslate("","System_Select","选择")',
            btn: ['@TranslateService.GetTranslate("","System_Confirm","确定")', '@TranslateService.GetTranslate("","System_Cancel","取消")'],
            height: '80%',
            url: modelurl + '/GetIndex?returnkey=' + returnkey,
            yes: function(window, index) {
                 $(obj).val(window.chekcName);
                 $(obj).next().val(window.chekcCode).trigger("propertychange");
                 dialogClose("form1");
            }
        });
    }
</script>
